﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSEngine
{
    public class PlayerTurnArgs: EventArgs
    {
        private GameBoard board;
        private Move? lastMove;
        private Player lastPlayer;

        public PlayerTurnArgs(GameBoard b, Move? mv, Player p)
        {
            lastPlayer = p;
            board = GameBoard.DeepCopy(b);
            if (mv.HasValue)
            {
                lastMove = new Move();
                Move tmp = mv.GetValueOrDefault(), newMove = lastMove.GetValueOrDefault();
                newMove.x = tmp.x;
                newMove.y = tmp.y;
            }
            else
                lastMove = null;
        }

        public Player LastPlayer
        {
            get { return lastPlayer; }
            set { lastPlayer = value; }
        }

        public GameBoard Board
        {
            get { return board; }
        }

        public Move? LastMove
        {
            get { return lastMove; }
        }
    }
}
